package com.startech.controller;

import com.startech.common.domain.vo.Result;
import com.startech.domain.Problem;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/problem")
@Api(tags = "Problem相关接口")
@RequiredArgsConstructor
public class ProblemController {
    @GetMapping("/{problemId}")
    public Result getProblem(@PathVariable Integer problemId) {
        Problem problem = Problem.builder()
                .problemId(problemId)
                .title("垂径定理综合题")
                .content("在⊙O中，AB为直径…")
                .diagram("…")
                .answer("∠ACB = 90°")
                .solutionSteps("1. 连接 OC …")
                .build();

        return Result.success(problem);
    }
}
